import service from "@/utils/request.ts";
import {COMPLETE_PRE} from '@/api/port-info.ts'

/**
 * 获取用户信息列表
 * @param params 参数
 */
export async function getUserListReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/getList',
        method: 'POST',
        data: params
    });
}

/**
 * 获取字典下拉框数据
 * @param params 参数
 */
export async function getDictDropReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/getDropBoxData',
        method: 'POST',
        data: params
    });
}

/**
 * 保存用户信息
 * @param params 参数
 */
export async function saveUserInfoReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/saveUserInfo',
        method: 'POST',
        data: params
    });
}

/**
 * 获取单体用户信息
 * @param params 参数
 */
export async function getOneUserInfoReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/getOneUser',
        method: 'POST',
        data: params
    });
}

/**
 * 停用用户
 * @param params 参数
 */
export async function stopUserReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/stopUser',
        method: 'POST',
        data: params
    });
}

/**
 * 启用用户
 * @param params 参数
 */
export async function restartUserReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/restartUser',
        method: 'POST',
        data: params
    });
}

/**
 * 删除用户
 * @param params 参数
 */
export async function delUserReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/delUser',
        method: 'POST',
        data: params
    });
}

/**
 * 重置密码
 * @param params 参数
 */
export async function resetPasswordReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/resetPassword',
        method: 'POST',
        data: params
    });
}

/**
 * 获取用户角色Ids
 * @param params 参数
 */
export async function getUserRoleIdsReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/getUserRoleIds',
        method: 'POST',
        data: params
    });
}

/**
 * 保存用户角色信息
 * @param params 参数
 */
export async function saveUserRoleIdsReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/saveUserRoleIds',
        method: 'POST',
        data: params
    });
}

/**
 * 获取所有用户信息下拉框
 * @param params 参数
 */
export async function getAllUserDropDownReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/user/getAllUserDropDown',
        method: 'POST',
        data: params
    });
}